layui.use(['form','element'],function() {
        layer = layui.layer,form = layui.form, element = layui.element;
});



function xconfirm(title,url,parms){
	
	layer.confirm(title, {icon: 3, title:'提示'}, function(index){
		  //do something
		  if(url){
			  
			  $.ajax({
	      			type:"POST", 
	      			url:url,
	      			data:parms ,
	      			success:function(result) {
			      
			      		if(result.code=='1'){
			      			layer.msg('操作成功');
			      			window.location.reload();
			      		}else{
			      		 	layer.msg(result.msg);
			      		}
			      
			    	 	} 
			    }); 
		  }
	    layer.close(index);
	});
}

function openwinx(title,url,w,h){
	
	if (title == null || title == '') {
        title=false;
    };
    if (url == null || url == '') {
        url="404.html";
    };
    if (w == null || w == '') {
        w=($(window).width()*0.9);
    };
    if (h == null || h == '') {
        h=($(window).height() - 50);
    };
    
    
    layer.open({
        type: 2,
        area: [w+'px', h +'px'],
        maxmin: true,
        shadeClose: true,
        shade:0.4,
        title: title,
        scrollbar: true,
        content: url
    });
    
	
}